﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Admin/Admin.master" AutoEventWireup="True" Inherits="GMS.Pages_Admin_StoneTypeCategory" Codebehind="StoneTypeCategory.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div>
        <div>
            <div>
                Select Stone Type:
                <asp:DropDownList ID="ddlStoneType" runat="server" DataSourceID="ldsStoneType" DataTextField="Name"
                    DataValueField="Id" />
            </div>
            <div>
                Select Stone Category:
                <asp:DropDownList ID="ddlStoneCategory" runat="server" DataSourceID="ldsStoneCategory"
                    DataTextField="Name" DataValueField="Id" />
            </div>
            <div>
                Enter Image Path:
                <asp:TextBox ID="txtImagePath" runat="server"></asp:TextBox>
            </div>
            <br />
            <asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="btnAdd_Click" />
        </div>
        <br />
        <div>
            <asp:GridView ID="gvStoneTypeCategory" runat="server" AllowPaging="True" AllowSorting="True"
                AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="lds" BackColor="White"
                BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black"
                GridLines="Vertical">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" HeaderText="Operations" />
                    <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True"
                        SortExpression="Id" />
                     <asp:TemplateField HeaderText="StoneTypeId" SortExpression="StoneTypeId">
                        <ItemTemplate>
                            <asp:DropDownList ID="dlStoneType" runat="server" DataSourceID="ldsStoneType" DataTextField="Name"
                                DataValueField="Id" SelectedValue='<%# Bind("StoneTypeId") %>' Enabled="false" />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="dlEditStoneType" runat="server" DataSourceID="ldsStoneType"
                                DataTextField="Name" DataValueField="Id" SelectedValue='<%# Bind("StoneTypeId") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="StoneCategoryId" SortExpression="StoneCategoryId">
                        <ItemTemplate>
                            <asp:DropDownList ID="dlStoneCategory" runat="server" DataSourceID="ldsStoneCategory"
                                DataTextField="Name" DataValueField="Id" SelectedValue='<%# Bind("StoneCategoryId") %>'
                                Enabled="false" />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="ddlEditStoneCategory" runat="server" DataSourceID="ldsStoneCategory"
                                DataTextField="Name" DataValueField="Id" SelectedValue='<%# Bind("StoneCategoryId") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                   
                    <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True"
                        SortExpression="Id" />
                    <asp:BoundField DataField="StoneTypeId" HeaderText="StoneTypeId" SortExpression="StoneTypeId" />
                    <asp:BoundField DataField="StoneCategoryId" HeaderText="StoneCategoryId" SortExpression="StoneCategoryId" />
                    <asp:TemplateField HeaderText="ImagePath" SortExpression="ImagePath">
                        <ItemTemplate>
                            <asp:Image ID="imgImagePath" runat="server" ImageUrl='<%# Bind("ImagePath") %>' AlternateText='<%# Bind("ImagePath") %>'
                                ToolTip='<%# Bind("ImagePath") %>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtImagePath" runat="server" Text='<%# Bind("ImagePath") %>' />
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:CheckBoxField DataField="IsActive" HeaderText="IsActive" SortExpression="IsActive" />
                    <asp:BoundField DataField="ModifiedDate" HeaderText="ModifiedDate" SortExpression="ModifiedDate"
                        ReadOnly="true" />
                    <asp:BoundField DataField="CreationDate" HeaderText="CreationDate" SortExpression="CreationDate"
                        ReadOnly="true" />
                </Columns>
                <FooterStyle BackColor="#CCCC99" />
                <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                <RowStyle BackColor="#F7F7DE" />
                <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                <SortedAscendingCellStyle BackColor="#FBFBF2" />
                <SortedAscendingHeaderStyle BackColor="#848384" />
                <SortedDescendingCellStyle BackColor="#EAEAD3" />
                <SortedDescendingHeaderStyle BackColor="#575357" />
            </asp:GridView>
            <asp:LinqDataSource ID="lds" runat="server" ContextTypeName="DAL.DataClasses1DataContext"
                EnableDelete="True" EnableInsert="True" EnableUpdate="True" EntityTypeName=""
                TableName="StoneTypeCategories">
            </asp:LinqDataSource>
            <asp:LinqDataSource ID="ldsStoneType" runat="server" ContextTypeName="DAL.DataClasses1DataContext"
                EntityTypeName="" TableName="StoneTypes">
            </asp:LinqDataSource>
            <asp:LinqDataSource ID="ldsStoneCategory" runat="server" ContextTypeName="DAL.DataClasses1DataContext"
                EntityTypeName="" TableName="StoneCategories">
            </asp:LinqDataSource>
        </div>
    </div>
</asp:Content>
